package com.stationpc.dock.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.stationpc.dock.AppInfo
import com.stationpc.dock.R

class AppInfoActivity : AppCompatActivity() {

    private lateinit var appInfo: AppInfo

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_app_info)

        appInfo = intent.getParcelableExtra("appInfo")!!

        val iconView = findViewById<ImageView>(R.id.appIcon)
        val nameView = findViewById<TextView>(R.id.appName)
        val packageNameView = findViewById<TextView>(R.id.appPackageName)

        iconView.setImageDrawable(appInfo.icon)
        nameView.text = appInfo.name
        packageNameView.text = appInfo.packageName
    }
}
